package com.cz.video.common.vod.dto;

import cn.hutool.core.util.ObjectUtil;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.HashMap;
import java.util.Map;

/**
 * @ClassName : VodUploadAuth
 * @Description : vod授权信息
 * @Author : 陈智
 * @Date: 2023/7/8  17:08
 */
@Data
@Schema(title = "vod授权信息")
public class VodUploadAuth {

    @Schema(title = "vid")
    private String vid;

    @Schema(title = "上传地址")
    private String uploadAddress;

    @Schema(title = "上传授权")
    private String uploadAuth;

    @Schema(title = "服务提供商")
    private String service;

    @Schema(description = "额外消息")
    private Map<String,Object> extraInfo;

    public VodUploadAuth addExtraInfo(String key ,Object value){
        if (ObjectUtil.isNull(extraInfo))
            extraInfo= new HashMap<>();
        extraInfo.put(key, value);
        return this;
    }
}
